package com.bhs.controller;

import com.bhs.pojo.Item;
import com.bhs.pojo.MainMenu;
import com.bhs.service.Product.ProductService;
import com.bhs.vo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/menu/product")
@CrossOrigin
public class ProductController {
    @Autowired
    private ProductService productService;
    //商品详情
    @PostMapping("/getDetails/{id}")
    public ResponseData getDetails(@PathVariable("id") Integer id){
        Item productDetails=productService.getDetails(id);
        return ResponseData.success(productDetails);
    }
    //商品列表
    @PostMapping("/getGoodsList")
    public ResponseData getGoodsList(){
        List<MainMenu> goodsList=productService.getGoodsList();
        return ResponseData.success(goodsList);
    }
    @PostMapping("/getGoodsList1")
    public ResponseData getGoodsList1(){
        List<Item> items1=productService.getGoodsList1();
        return ResponseData.success(items1);
    }
    @PostMapping("/getGoodsList2")
    public ResponseData getGoodsList2(){
        List<Item> items2=productService.getGoodsList2();
        return ResponseData.success(items2);
    }
    @PostMapping("/getGoodsList3")
    public ResponseData getGoodsList3(){
        List<Item> items3=productService.getGoodsList3();
        return ResponseData.success(items3);
    }
    @PostMapping("/getGoodsList4")
    public ResponseData getGoodsList4(){
        List<Item> items4=productService.getGoodsList4();
        return ResponseData.success(items4);
    }
    @PostMapping("/getGoodsList5")
    public ResponseData getGoodsList5(){
        List<Item> items5=productService.getGoodsList5();
        return ResponseData.success(items5);
    }
    @PostMapping("/getGoodsList6")
    public ResponseData getGoodsList6(){
        List<Item> items6=productService.getGoodsList6();
        return ResponseData.success(items6);
    }
}
